import {requestForm8082} from './requestForm8082.ts';
import axios, {post} from "axios";
import {Ref, ref} from "vue";
import {requestJson, requestJson8084} from "./requestJson8084.ts";
import {requestJson8082} from "./requestJson8082.ts";


// export function testPostRequestParam(data) {
//     let url = "/user-server/user/testRequestParam"
//     return requestForm8082({
//         url: url,
//         method: 'post',
//         data
//     })
// }
//
// export function testPostRequestBody(data) {
//     let url = "/user-server/user/testRequestBody"
//     return requestJson({
//         url: url,
//         method: 'post',
//         data
//     })
// }

export function userLogin(data) {
    let url = "/user-server/user/login"
    return requestJson8082({
        url: url,
        method: 'post',
        data
    })
}
// 但是我调了这个方法（用 xiaogang 审核人身份 去登录），然后去调这个接口getCheckTaskList，接口返回是空。
export function userRegister(data) {
    let url = "/user-server/user/register"
    return requestJson8082({
        url: url,
        method: 'post',
        data
    })
}

//发送{
//   "limit": 0,//一页的容量
//   "offset": 0 //第几页
// }
// 获取 角色权限表
export function getUserRole(data) {
    let url = "/user-server/user/get_user"
    return requestJson8082({
        url: url,
        method: 'post',
        data
    })
}

export function addUserRole(data) {
    let url='/user-server/user/add_role'
    return requestJson8082({
        url: url,
        method: 'post',
        data
    })
}

export function getUserByRole(data) {
    let url='/user-server/user/get_user_by_role'
    return requestJson8082({
        url: url,
        method: 'post',
        data
    })
}

export function removeUser(params) {
    let url='/user-server/user/remove_user'
    return requestForm8082({
        url: url,
        method: 'get',
        params
    })
}

export function getUserById(params) {
    let url='/user-server/user/get_user_by_id'
    return requestForm8082({
        url: url,
        method: 'get',
        params
    })
}
// export function shopOnShelf(shopId,itemId) {
//     let url='/shop/onShelf/'+shopId+'/'+itemId
//     return requestForm8082({
//         url: url,
//         method: 'get'
//     })
// }